package com.itheima.date.mydate;

import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

public class Demo3 {
    public static void main(String[] args) {
        method1();
        method2();
    }

    private static void method2() {
        LocalDateTime localDateTime = LocalDateTime.of(2000, 10, 11, 12, 13, 14);
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
        String s = localDateTime.format(dateTimeFormatter);
        System.out.println(s);
    }

    private static void method1() {

        String s = "2000年10月11日 12:13:14";
        DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
        LocalDateTime parse = LocalDateTime.parse(s, pattern);
        System.out.println(parse);
    }
}
